import sys
from PyQt5.QtCore import *


class EnemyShootThread(QThread):

    def SetAllEnemy(self, AllEnemy):
        self.AllEnemy = AllEnemy

    def run(self):
        for i in range(10):
            for Enemy in self.AllEnemy.EnemySetList[i + 20].EnemyList:
                if Enemy.isVisible():
                    if -90 > Enemy.Rotate > -270:
                        self.AllEnemy.CallEnemyBullet(Enemy.mapToScene(-55, 0).x(), Enemy.mapToScene(-55, 0).y(), Enemy.Rotate)
                    else:
                        self.AllEnemy.CallEnemyBullet(Enemy.mapToScene(55, 0).x(), Enemy.mapToScene(55, 0).y(), Enemy.Rotate)
